//
//  NetingAPI.m
//  VoiceLive
//
//  Created by 凸阿滨 on 2017/10/20.
//  Copyright © 2017年 WB. All rights reserved.
//

#import "NetingAPI.h"

NSString *const hostIP = @"http://192.168.0.25:2050";

//接口：登录
NSString *const apiLogin = @"/v1/data/anchor/login";
//接口：房间信息
NSString *const apiLiveInfo = @"/v1/data/anchor/get_channel_info";
//接口：收听人数
NSString *const apiListenPeople = @"/v1/data/anchor/get_online_count";
//接口：黑名单列表
NSString *const apiBlack_list = @"/v1/data/anchor/get_black_list";
//接口：聊天室
NSString *const apiChatRoom = @"/v1/view/phostess.html?";
//接口：开始直播
NSString *const apiStartLive = @"/v1/data/anchor/start_live";
//接口：解禁
NSString *const apiRelieve_black = @"/v1/data/anchor/relieve_black";
//接口：oss证书接口
NSString *const apiOSSclient = @"/v1/data/anchor/sign_oss_phone";
//接口：修改图像
NSString *const apiEditImage = @"/v1/data/anchor/edit_anchor_img";

@implementation NetingAPI


//登录api
-(NSString *)urlStringWithModuleLoginTag:(UFLoginTag)tag{
    NSString *tempStr = nil;
    switch (tag) {
        case KUFLogin:
            tempStr = [self urlStringAppending:apiLogin];
            break;
            
        default:
            break;
    }
    
    return tempStr;
    
}
//主播api
-(NSString *)urlStringWithModuleLiveTag:(UFLiveTag)tag{
    NSString *tempStr = nil;
    switch (tag) {
        case KUFLiveInfo:
            tempStr = [self urlStringAppending:apiLiveInfo];
            break;
        case KUFListenPeople:
            tempStr = [self urlStringAppending:apiListenPeople];
            break;
        case KUFBlackList:
            tempStr = [self urlStringAppending:apiBlack_list];
            break;
        case KUFChatRoom:
            tempStr = [self urlStringAppending:apiChatRoom];
            break;
        case KUFStartLive:
            tempStr = [self urlStringAppending:apiStartLive];
            break;
        case KUFRelve_Black:
            tempStr = [self urlStringAppending:apiRelieve_black];
            break;
        case KUFApiOSS:
            tempStr = [self urlStringAppending:apiOSSclient];
            break;
        case KUFEditImage:
            tempStr = [self urlStringAppending:apiEditImage];
            break;
        default:
            break;
    }
    
    return tempStr;
    
}

- (NSString *)urlStringAppending:(NSString *)api{
    NSString * url = [NSString stringWithFormat:@"%@%@",hostIP,api ];
    return url;
}


+ (NetingAPI *)shared{
    
    static NetingAPI *_api = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _api = [[self alloc] init];
    });
    return _api;
    
}





@end
